package com.wangshouyu.mp.menu;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月06日 22:10:27
 * @description: 微信菜单
 */
public class Menu implements Serializable {

    /**
     * 菜单编号
     */
    @SerializedName(value = "menuid")
    @JsonProperty(value = "menuid")
    @JSONField(name = "menuid")
    private String menuId;

    /**
     * 按钮
     */
    private List<Button> button;

    public List<Button> getButton() {
        return button;
    }

    public void setButton(List<Button> button) {
        this.button = button;
    }

    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Menu menu = (Menu) o;
        return Objects.equals(menuId, menu.menuId) &&
                Objects.equals(button, menu.button);
    }

    @Override
    public int hashCode() {
        return Objects.hash(menuId, button);
    }

    @Override
    public String toString() {
        return "Menu{" +
                "menuId='" + menuId + '\'' +
                ", button=" + button +
                '}';
    }

    public Menu(String menuId) {
        this.menuId = menuId;
    }

    public Menu() {
    }
}
